package com.oa.business.acl;


import com.oa.common.result.Result;
import com.oa.framework.acl.url.domain.SystemUrlResource;
import com.oa.framework.acl.url.dao.SystemUrlResourceDao;
import com.oa.framework.acl.url.service.ResourceManagementService;
import com.oa.framework.acl.url.service.SystemUrlResourceService;
import com.oa.framework.org.department.service.DepartmentService;
import com.oa.framework.org.service.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 获取系统控制权限接口
 */
@RestController
@RequestMapping("/acl")
public class AclController {

    @Autowired
    private SystemUrlResourceDao resourceDao;
    @Autowired
    private SystemUrlResourceService resourceService;
    @Autowired
    private ResourceManagementService managementService;

    @Autowired
    private PositionService positionService;
    @Autowired
    private DepartmentService departmentService;

    @GetMapping(value = "/get")
    public Result getAcl() {
        List<SystemUrlResource> resources = resourceDao.selectList(null);
        return Result.success(resources);
    }


    @GetMapping("/fold")
    public Result getFold() {
        return Result.success(resourceService.getFoldResource());
    }


    @GetMapping("fold1")
    public Object getFold1() {
        return Result.success(managementService.loadResourceManagement());
    }


    @GetMapping("fold2")
    public Object getFold2() {
        return departmentService.loadFoldDepartment();
    }



}
